<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
    <% String agent=request.getHeader("user-agent"); 
       System.out.println("user-agent="+agent);
       if(agent==null){
            request.getRequestDispatcher("/forwardToIndex.do").forward(request,response);
       }else if(agent.indexOf("iPhone")!=-1
          ||agent.indexOf("MOT")!=-1
          ||agent.indexOf("Nokia")!=-1
          ||agent.indexOf("LENOVO")!=-1
          ||agent.indexOf("PHILIPS")!=-1
          ||agent.indexOf("Dopod")!=-1
          ||agent.indexOf("Alcatel")!=-1
          ||agent.indexOf("TCL")!=-1
          ||agent.indexOf("NEC")!=-1
          ||agent.indexOf("LG")!=-1
          ||agent.indexOf("CECT")!=-1
          ||agent.indexOf("Ericsson")!=-1
          ||agent.indexOf("BIRD")!=-1
          ||agent.indexOf("DBTEL")!=-1
          ||agent.indexOf("PANTECH")!=-1
          ||agent.indexOf("BENQ")!=-1
          ||agent.indexOf("BenQ")!=-1
          ||agent.indexOf("KONKA")!=-1
          ||agent.indexOf("HAIER")!=-1
          ||agent.indexOf("Haier")!=-1
          ||agent.indexOf("KEJIAN")!=-1
          ||agent.indexOf("Android")!=-1
          ||agent.indexOf("Soutec")!=-1
          ){
       request.getRequestDispatcher("/wap").forward(request,response);
       }else {
       request.getRequestDispatcher("/forwardToIndex.do").forward(request,response);
       }
       %>
     
   
  </body>
</html>
